<template>
	<view v-if="count > 0" class="badge">{{ value }}</view>
</template>

<script>
export default{
	props: {
		count: { type: Number, default: 0 }
	},
	computed: {
		value(){
			return this.count > 99 ? '99+' : this.count
		}
	}
}
</script>

<style lang="scss" scoped>
.badge{
  color: #fff;
  padding: 0 12rpx;
  font-size: 24rpx;
  border-radius: 40rpx;
  @include line-height(32rpx);
  background-color: #ff5722;
  position: absolute;
  left: 100rpx;
  top: 6rpx;
}
</style>